package com.pms.exceptions;

public class ErrorCode {
	private int errorCode;
	private String shortName;
	private String errorMessage;
	

	public ErrorCode(int errorCode, String shortName, String errorMessage) {
		this.errorCode = errorCode;
		this.shortName = shortName;
		this.errorMessage = errorMessage;
	}
	
	public static ErrorCode getValue(int id) {
		switch(id) {
			case -1: return UNSPECIFIED;
			default: return UNSPECIFIED;
		}
	}
	
	public int getErrorCode() {
		return errorCode;
	}

	public String getErrorMessage() {
		return errorMessage;
	}

	public String getShortName() {
		return shortName;
	}

	public static final ErrorCode UNSPECIFIED = new ErrorCode(-1,"UNSPECIFIED", "Unspecified Error Code");
	public final static ErrorCode IO_ENCODING_ERROR = new ErrorCode(3,"IO_ENCODING_ERROR","IO_ENCODING_ERROR");
	public final static ErrorCode IO_DECODING_ERROR = new ErrorCode(4,"IO_DECODING_ERROR","IO_DECODING_ERROR");
	/** Login is invalid */
	public final static ErrorCode ATTRIBUTE_NOT_FOUND = new ErrorCode(1200,"ATTRIBUTE_NOT_FOUND","The system attribute could not be found.");

	/** The system attribute {0} is not an integer. */
	public final static ErrorCode ATTRIBUTE_NOT_INTEGER = new ErrorCode(1201,"ATTRIBUTE_NOT_INTEGER","The system attribute is not an integer.");

	/** The system attribute {0} is not a double. */
	public final static ErrorCode ATTRIBUTE_NOT_DOUBLE = new ErrorCode(1202,"ATTRIBUTE_NOT_DOUBLE","The system attribute is not a double.");

	/** The system attribute {0} is not a boolean. */
	public final static ErrorCode ATTRIBUTE_NOT_BOOLEAN = new ErrorCode(1203,"ATTRIBUTE_NOT_BOOLEAN","The system attribute is not a boolean.");


	/** No value is specified */
	public final static ErrorCode HTTP_ARGUMENT_NOT_FOUND = new ErrorCode(1600,"HTTP_ARGUMENT_NOT_FOUND","No value is specified");

	/** No value is specified */
	public final static ErrorCode HTTP_ARGUMENT_NOT_SET = new ErrorCode(1601,"HTTP_ARGUMENT_NOT_SET","No value is specified");

	/** The value is not a valid number */
	public final static ErrorCode HTTP_ARGUMENT_NOT_INT = new ErrorCode(1602,"HTTP_ARGUMENT_NOT_INT","The value is not a valid number");

	/** The value is not a valid number */
	public final static ErrorCode HTTP_ARGUMENT_NOT_DOUBLE = new ErrorCode(1603,"HTTP_ARGUMENT_NOT_DOUBLE","The value is not a valid number");

	/** The value is not a valid date */
	public final static ErrorCode HTTP_ARGUMENT_NOT_DATE = new ErrorCode(1604,"HTTP_ARGUMENT_NOT_DATE","The value is not a valid date");

	/** The value is not a valid true/false flag */
	public final static ErrorCode HTTP_ARGUMENT_NOT_BOOLEAN = new ErrorCode(1605,"HTTP_ARGUMENT_NOT_BOOLEAN","The value is not a valid true/false flag");

	/** Can not parse the integer array */
	public final static ErrorCode HTTP_ARGUMENT_CANT_PARSE_TO_INT_ARRAY = new ErrorCode(1606,"HTTP_ARGUMENT_CANT_PARSE_TO_INT_ARRAY","Can not parse the integer array");

	/** HTTP_INVALID_VALUE */
	public final static ErrorCode HTTP_INVALID_VALUE = new ErrorCode(1607,"HTTP_INVALID_VALUE","HTTP_INVALID_VALUE");

	/** EMAIL_ADDRESS_NOT_SPECIFIED */
	public final static ErrorCode EMAIL_ADDRESS_NOT_SPECIFIED = new ErrorCode(1701,"EMAIL_ADDRESS_NOT_SPECIFIED","Email Address not specified");

	/** EMAIL_ADDRESS_NOT_VALID */
	public final static ErrorCode EMAIL_ADDRESS_NOT_VALID = new ErrorCode(1702,"EMAIL_ADDRESS_NOT_VALID","Email Address is not valid");
	
	/** GENERIC_ERROR */
	public final static ErrorCode GENERIC_ERROR = new ErrorCode(1702,"GENERIC_ERROR","Following Error Occured");
	
	/** TEMPLATE_ERROR */
	public final static ErrorCode TEMPLATE_ERROR = new ErrorCode(1703,"TEMPLATE_ERROR","TEMPLATE_ERROR");
	
	/** EMAIL_SEND_ERROR **/
	public final static ErrorCode EMAIL_SEND_ERROR = new ErrorCode(1704,"EMAIL_SEND_ERROR","Error while sending email");
	
	public final static ErrorCode MOBILE_NO_ERROR = new ErrorCode(1704,"MOBILE_NO_ERROR","Error in mobile no");
	
	
}
